import request from '@/utils/request.js'

// 社区文章
export const listPage = (params, data) => request({ url: `/web/article/listPage`, method: 'post', data, params })
// 热门文章
export const popularList = (params) => request({ url: `/web/article/popularList`, method: 'get', params })
//文章点赞
export const articleLike = (params) => request({ url: `/web/article/like`, method: 'post', data: params })
//文章取消点赞
export const articleCancelLike = (params) => request({ url: `/web/article/cancelLike`, method: 'post', data: params })
//文章点赞
export const articleCollect = (params) => request({ url: `/web/article/collect`, method: 'post', data: params })
//文章取消点赞
export const cancelFavorite = (params) => request({ url: `/web/article/cancelFavorite`, method: 'post', data: params })
//创作者中心
export const getCustomerInfo = (params) => request({ url: `/web/article/getCustomerInfo`, method: 'get', params })
//分区列表
export const getZoningList = (params) => request({ url: `/web/zoning/listPage`, method: 'get', params })
//新增文章
export const articleAdd = (data) => request({ url: `/web/article`, method: 'post', data, loading: true })
//举报
export const articleReport = (params) => request({ url: `/web/article/report`, method: 'post', data: params })
//评论列表
export const getCommentList = (params, data) => request({ url: `/web/article/commentList`, method: 'post', data: data || {}, params })
//文章详情
export const getInfo = (params) => request({ url: `/web/article/getInfo`, method: 'get', params })
//文章评论
export const postComment = (params) => request({ url: `/web/article/comment`, method: 'post', data: params })
// 生成二维码
export const generateQrCode = (params) => request({ url: `/common/QrCode`, method: 'get', params, responseType: 'blob' })
//简历收藏列表
export const getCollectionList = (params) => request({ url: `/web/crewResume/collectionList`, method: 'get', params })
//删除社区文章
export const delArticle = (params) => request({ url: `/web/article/${params}`, method: 'delete' })
//取消简历收藏
export const crewResumeCancel = (params) => request({ url: `/web/crewResume/cancelFavorite`, method: 'post', data: params })
//平台公告
export const getNoticesList = (params) => request({ url: `/web/notices/list`, method: 'get', params })
